# $Id: PKGBUILD 182346 2013-04-08 17:32:17Z bluewind $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ignacio Galmarino <igalmarino@gmail.com>

pkgname=openresolv
pkgver=3.5.4
pkgrel=2
pkgdesc="resolv.conf management framework (resolvconf)"
arch=(any)
url="http://roy.marples.name/projects/openresolv"
license=('custom:BSD')
backup=(etc/resolvconf.conf)
provides=(resolvconf)
source=("http://roy.marples.name/downloads/openresolv/${pkgname}-${pkgver}.tar.bz2"
        fs33801.patch)
md5sums=('617a52fbe6f253f231d9f78f1ea74281'
         '440790d3403b2ae2c4bb1d657c7e36a4')

build() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../fs33801.patch
  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/resolvconf
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
  sed -n '2,25{s:^# \?::;p}' resolvconf.in > "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
